<template>
    <div class="index">
        <indexList :list="list" @success="getDirectory"/>
    </div>
</template>

<script>
    import { getHomeDirectory }  from '@/api/home'
    import indexList from '@/components/index/indexList.vue'
    export default {
        components : {
            indexList
        },
        data() {
            return {
                list : [],
            }
        },
        created(){
            this.getDirectory()
        },
        methods : {
            getDirectory(){
                getHomeDirectory().then(res => {
                    if (res.code == 200) {
                        this.list = res.data
                    }
                })
            }
        }
    }
</script>

<style lang="less" scoped>
.index{
    padding: 20px;
    background-color: #fff;
}
</style>